import type { ProcessItem, SysFileInfo, SysInfo } from '@vben/types';

import { requestClient } from '#/api/request';

/**
 * 获取系统信息
 */
export async function getSystemInfo() {
  return requestClient.get<SysInfo>('/sys-info/info');
}

/**
 * 刷新系统信息
 */
export async function refreshSystemInfo() {
  return requestClient.get<SysInfo>('/sys-info/refresh');
}

/**
 * 获取进程信息
 */
export async function getTopProcess(data: object) {
  return requestClient.get<ProcessItem[]>('/sys-info/top-process', {
    params: data,
  });
}

/**
 * 获取最近的信息
 */
export async function getRecentInfo() {
  return requestClient.get<SysInfo[]>('/sys-info/recentInfo');
}

/**
 * 获取文件信息
 */
export async function getFileInfo() {
  return requestClient.get<SysFileInfo[]>('/sys-info/fileInfo');
}
